package fr.esiea.erg5203.persistence.dao.applicationLifeCycleDAO;

import java.util.List;

import fr.esiea.erg5203.business.Contact;
import fr.esiea.erg5203.persistence.dao.DAO;
import fr.esiea.erg5203.persistence.database.ApplicationLifeCycleDatabase;

public class ApplicationLifeCycleContactDAO extends DAO<Contact>{

	private ApplicationLifeCycleDatabase database;
	
	public ApplicationLifeCycleContactDAO() {
		
		database = ApplicationLifeCycleDatabase.getInstance();
	}
	
	@Override
	public List<Contact> getAll() {
		
		return database.getAll();
	}

	@Override
	public Contact find(int id) {
		
		return database.find(id);
	}

	@Override
	public Contact create(Contact obj) {
		
		database.add(obj);
		
		return obj;
	}

	@Override
	public Contact update(Contact obj) {
		
		database.update(obj);
		
		return obj;
	}

	@Override
	public void delete(int id) {
		
		database.remove(id);
	}

}
